<?php

namespace apiend\modules\test\controllers;

use Yii;
use apiend\components\Controller;
use common\models\course\CourseGroup;

/**
 * Default controller for the `test` module
 */
class RongyunController extends Controller {

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionJoin($id) {
        $model = CourseGroup::findOne($id);
        return CourseGroup::joinGroup($this->token->user_id, $model);
    }

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex() {
        return $this->user->meta;
        $transport = Yii::$app->rongyun->transport('user');

        return $transport->getToken($this->token->user_id, 'username', 'http://www.rongcloud.cn/images/logo.png');
    }

}
